← Back to Home
🎯 Behavioral Pattern
Strategy Pattern
What is the Strategy Pattern?
The Strategy pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable. It lets the algorithm vary independently from clients that use it.
Key Concept: Instead of implementing a single algorithm directly, code receives runtime instructions on which algorithm to use from a family of algorithms.